package com.chexiehui.jc.mvp.mine;

import com.chexiehui.jc.Constants;
import com.chexiehui.jc.base.BaseModel;
import com.chexiehui.jc.base.BaseView;
import com.chexiehui.jc.entity.MerchantAuthInfo;
import com.chexiehui.jc.entity.MerchantAuthParamsInfo;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

/**
 * @Description 车商认证
 * @Auth SongJun
 * @Date 2020/05/21 00:18
 **/
public interface CarMerchantAuthCovenant {

    interface View extends BaseView {
        void onGetAuthParamsSuccess(BaseModel<MerchantAuthParamsInfo> successResult);

        void onGetAuthParamsFailure(BaseModel<Object> failureResult);

        void onGetMerchantAuthInfoSuccess(BaseModel<MerchantAuthInfo> successResult);

        void onGetMerchantAuthInfoFailure(BaseModel<Object> failureResult);

        void onUploadShopImageSuccess(BaseModel<String> successResult);

        void onUploadShopImageFailure(BaseModel<Object> failureResult);

        void onUploadShopEnvironmentSuccess(BaseModel<String> successResult);

        void onUploadShopEnvironmentFailure(BaseModel<Object> failureResult);

        void onUploadLicenseImageSuccess(BaseModel<String> successResult);

        void onUploadLicenseImageFailure(BaseModel<Object> failureResult);

        void onSaveSuccess(BaseModel<Object> successResult);

        void onSaveFailure(BaseModel<Object> failureResult);

        MerchantAuthInfo getMerchantAuthInfo();

    }

    interface Stores {
        @FormUrlEncoded
        @POST(Constants.URL_MERCHANT_AUTH_PARAMS)
        Observable<BaseModel<MerchantAuthParamsInfo>> getAuthParams(@Field("timespan") String timespan);

        @FormUrlEncoded
        @POST(Constants.URL_GET_MERCHANT_AUTH_INFO)
        Observable<BaseModel<MerchantAuthInfo>> getMerchantAuthInfo(@Field("timespan") String timespan);

        @FormUrlEncoded
        @POST(Constants.URL_ADD_MERCHANT_AUTH_INFO)
        Observable<BaseModel<Object>> save(
                @Field("companyType") String companyType,
                @Field("companyName") String companyName,
                @Field("storeName") String storeName,
                @Field("storeAdress") String storeAdress,
                @Field("imgs") String imgs,
                @Field("authfile") String authfile,
                @Field("envirImgs") String envirImgs,
                @Field("lat") double lat,
                @Field("lon") double lon
        );
    }

    interface Presenter {
        void getAuthParams();
        void getMerchantAuthInfo();
        void uploadShopImage(String filePath);
        void uploadShopEnvironment(String filePath);
        void uploadLicenseImage(String filePath);
        void save();
    }

}